package de.kuttenmann.jflake;
public class Hit
{
	public static final double INFINITY = Double.POSITIVE_INFINITY;
	public static final Hit NO_HIT = new Hit(INFINITY);

	private final Vector3D normal;
	private final double distance;

	public Hit(Vector3D normal, double distance)
	{
		this.normal = normal;
		this.distance = distance;
	}

	public Hit(double distance)
	{
		this(Vector3D.ZERO, distance);
	}

	public Vector3D getNormal()
	{
		return normal;
	}

	public double getDistance()
	{
		return distance;
	}

	@Override
	public String toString()
	{
		return String.format("[normal=%s; distance=%f]", this.normal.toString(), this.distance);
	}
}
